<?php

class Dan
{
    public static $guoName;
    protected static $dan = null;

    private function __construct($guoName)
    {
        self::$guoName = $guoName;
    }

    public static function getDan($guoName)
    {
        if (!self::$dan instanceof self) {
            self::$dan = new self($guoName);
        }
        return self::$guoName;
    }
}

class Gongcang
{

    public static function create($guoName)
    {
        return Dan::getDan($guoName);
    }
}

class ObjShu
{
    public static $guokuang = [];

    public static function shangshu($key, $guo)
    {
        self::$guokuang[$key] = $guo;
    }

    public static function zhaiqu($key)
    {
        return self::$guokuang[$key];
    }

    public static function xiaohui($key)
    {
        unset(self::$guokuang[$key]);
    }
}

ObjShu::shangshu('guo', Gongcang::create('香蕉'));
$guo = ObjShu::zhaiqu('guo');
var_dump($guo);